home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / cmsrc392.zip / GREEKL.MF < prev    next >
Text File  |  1992-03-30  |  22KB  |  492 lines

  1. % This lowercase Greek alphabet was prepared by D. E. Knuth in December, 1979,
  2. % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
  3. % (It has been designed for math formulas, not Greek texts.)
  4. % The programs were revised for the new \MF\ conventions in 1985.
  5.  
  6. % Character codes \0013--\0047 are generated.
  7.  
  8. cmchar "Lowercase Greek alpha";
  9. beginchar(oct"013",11u#,x_height#,0);
  10. italcorr max(1/3x_height#*slant+.5hair#+.5u#,x_height#*slant-.5u#);
  11. adjust_fit(0,0); pickup fine.nib;
  12. pos0(hair,0); pos1(vair,-90); pos2(curve,-180); pos3(vair,-270);
  13. z4=(w-3.25u,9/16h); z5=(w-2.75u,.5[vair,y4]);
  14. numeric theta; theta=angle(z4-z5)-90;
  15. pos4(stem,theta); pos5(stem,theta);
  16. pos6(vair,90); pos7(hair,180);
  17. rt x0r=hround(w-u); x1=x3=.5w-u; lft x2r=hround(1.5u-.5curve);
  18. x6=w-u; x7+.5hair=hround(w+.5hair-epsilon);
  19. top y0=vround .8[bar_height,h]; bot y1r=bot y6l=-oo;
  20. y2=.5[y1,y3]; top y3r=h+oo; y7=1/4bar_height;
  21. filldraw stroke z0e{down}...pulled_arc.e(1,2) & pulled_arc.e(2,3)
  22.  ...z4e---z5e...z6e{right}...{up}z7e; % diagonal, bowl, and hook
  23. math_fit(-.3x_height#*slant+.5curve#-u#,1/3x_height#*slant+.5hair#+.5u#);
  24. penlabels(0,1,2,3,4,5,6,7); endchar;
  25.  
  26. cmchar "Lowercase Greek beta";
  27. beginchar(oct"014",9.5u#,asc_height#,desc_depth#);
  28. italcorr .5[x_height#,asc_height#]*slant-u#;
  29. adjust_fit(0,0); pickup fine.nib;
  30. pos0(hair,180); pos1(hair,180); pos2(vair,90);
  31. pos3(stem,0); pos4(vair,-90); pos5(hair,-180);
  32. pos6(vair,-270); pos7(curve,-360); pos8(vair,-450); pos9(hair,-540);
  33. x0=x1=x9; lft x0l=hround(1.5u-.5hair); x2=x4=x6=x8=.5w+.25u;
  34. rt x3r=hround(w-1.5u); rt x7r=hround(w-1.5u+.5curve); rt x5l=hround(x4-u);
  35. bot y0=-d; y1=top y6r=x_height; top y2r=h+oo; y3=.5[y2,y4];
  36. y5=.5[y4,y6]; top y6r-bot y4r=vstem+eps; bot y8=-oo; y7=y9=.5[y6,y8];
  37. if y6l<y4l: y6l:=y4l:=y5; fi
  38. filldraw stroke z0e---z1e...pulled_arc.e(2,3)
  39.  & pulled_arc.e(3,4)...{up}z5e;  % stem and upper bowl
  40. filldraw stroke z5e{up}...pulled_arc.e(6,7)
  41.  & pulled_arc.e(7,8)...{up}z9e;  % lower bowl
  42. math_fit(desc_depth#*slant+.5hair#-u#,.7x_height#*slant+.5curve#-1.5u#);
  43. penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
  44.  
  45. cmchar "Lowercase Greek gamma";
  46. beginchar(oct"015",10u#,x_height#,desc_depth#);
  47. italcorr x_height#*slant-.5u#;
  48. adjust_fit(0,0); pickup fine.nib;
  49. pos1(hair,180); pos2(vstem+dw,90);
  50. pos4(hair,0); pos5(vair,-90); pos6(hair,-180); pos7(hair,-180);
  51. bot y1=.5772156649h; top y2r=h+oo; y4=y6=-.5d;
  52. bot y5r=-d-o; top y7=h;
  53. lft x1r=hround(.5u-.5hair); x2=3u; rt x4r=hround(w-2u); x5=.5[x4,x6];
  54. rt x4r-lft x6r=hround 1/3[hair,stem]+eps; rt x7l=hround(w-u);
  55. if x4l<x6l: x4l:=x6l:=x5; fi
  56. pos3(hair,angle(z4-z2)+90); x3=superness[x2,x4]; y3=superness[y4,y2];
  57. filldraw stroke z1e{up}...z2e{right}...z3e{z4-z2}
  58.  ...z4e{down}...{left}z5e; % arc
  59. filldraw stroke z5e{left}...z6e{up}..{2(x7-x6),y7-y6}z7e;  % stem
  60. math_fit(-.5772156649x_height#*slant,ic#-u#);
  61. penlabels(1,2,3,4,5,6,7); endchar;
  62.  
  63. cmchar "Lowercase Greek delta";
  64. beginchar(oct"016",8u#,asc_height#,0);
  65. italcorr .9asc_height#*slant+.5hair#-1.5u#;
  66. adjust_fit(0,0); pickup fine.nib;
  67. x0=-u; y0=1.1h;
  68. numeric light_flare; light_flare=2/3[vair,flare];
  69. x1=w-2u-.5light_flare; y1=h-.5light_flare;
  70. numeric theta; theta=angle (z1-z0);
  71. pos1(light_flare,theta-90); pos2(.2[vair,light_flare],-90); pos3(vair,theta);
  72. x2=x3+u; y2=h;
  73. x4=x6=.5w+.5u; top y8r=x_height+oo; z4=z8;
  74. pos6(vair,-90); pos7(stem,-180); pos8(vair,-270);
  75. pos4(stem,angle(z4-z0)+90); pos5(stem,30);
  76. z3=.5[.5[z1,z4],z0];
  77. y5+.1x_height=y7=.5[y6,y8]; bot y6=-oo;
  78. lft x7r=hround(1.4u-.5stem); rt x5r=hround(w-u);
  79. filldraw stroke z1e{z0-z1e}....z2e....z3e{(z0-z1)rotated 90}
  80.  ...z4e{z4e-.8[z4,z0]}
  81.  ....z5e{down}...pulled_arc.e(6,7) & pulled_arc.e(7,8);  % hook and bowl
  82. filldraw z1r{z1r-z0}...z1l{z0-z1l}--cycle; % bulb
  83. math_fit(-.3x_height#*slant+.5curve#-u#,.7x_height#*slant-.5u#);
  84. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  85.  
  86. cmchar "Lowercase Greek epsilon";
  87. beginchar(oct"017",8u#,x_height#,0);
  88. italcorr x_height#*slant+.5hair#-2u#;
  89. adjust_fit(0,0); pickup fine.nib;
  90. pos0(bar,90); pos1(bar,90); pos2(curve,180);
  91. pos3(vair,270); pos4(hair,300); pos6(bar,90); pos7(bar,90);
  92. x1=.5w+.5u; x0=x1+u; lft x2r=hround(1.5u-.5curve); x3=.5[x0,x1];
  93. x4r=good.x(w-u); x5=w+.5u; x6=x0; z7=z2l;
  94. top y0r=top y1r=h; y2=y5=y6=bar_height; bot y3r=-oo;
  95. path p; p=z3r{right}...{up}z5;
  96. numeric t; t=ypart(((x4r,y3r)--(x4r,y5))intersectiontimes p);
  97. y4r=ypart point t of p;
  98. filldraw circ_stroke z0e..pulled_arc.e(1,2) & pulled_arc.e(2,3)
  99.  ...z4e{direction t of p};  % arc
  100. filldraw circ_stroke z6e--z7e;  % bar
  101. math_fit(-.3x_height#*slant+.5curve#-u#,ic#);
  102. penlabels(0,1,2,3,4,5,6,7); endchar;
  103.  
  104. cmchar "Lowercase Greek zeta";
  105. beginchar(oct"020",9u#,asc_height#,desc_depth#);
  106. italcorr .75[x_height#,asc_height#]*slant-1.5u#;
  107. adjust_fit(0,0); pickup fine.nib;
  108. pos0(hair,-360); pos1(vair,-270); pos2(hair,-180); pos3(vair,-90);
  109. numeric theta; theta=90-angle(25u,x_height); slope:=-x_height/25u;
  110. pos6(stem,theta); pos7(vair,-90); pos8(vair,-135);
  111. lft x0l=hround 3.5u; x1=x3=.5[x0,x2]; rt x2l=hround max(rt x0r,w-2u)+eps;
  112. top y0=h; top y3l=bot y1l+vstem+eps=vround(y0-.25(h-x_height)); y2=.5[y1,y3];
  113. if y1r>y3r: y1r:=y3r:=y2; fi
  114. lft x4l=hround u; x4r-x4l=(hround .6[vair,stem])-fine;
  115. x6+.5u=x7=w-2u; x8=.5w+.75u;
  116. y6=-.1d; y8=-3/4d-oo; bot y7r=-d-oo;
  117. ellipse_set(3l,4l,5l,6l); ellipse_set(3r,4r,5r,6r);
  118. y4l:=.9[y6,y4l]; y4=y4r:=.9[y6,y4r];
  119. filldraw circ_stroke z0e{down}...z1e{right}...{up}z2e;  % opening hook
  120. filldraw circ_stroke z8e{x7-x8,2(y7-y8)}...z7e{right}
  121.  ...z6e---z5e....{up}z4e
  122.  ..tension 1 and atleast1.5..{right}z3e...{down}z2e;  % main stroke
  123. math_fit(-.2asc_height#*slant-.5u#,0);
  124. penlabels(0,1,2,3,4,5,6,7,8); endchar;
  125.  
  126. cmchar "Lowercase Greek eta";
  127. beginchar(oct"021",9u#,x_height#,desc_depth#);
  128. italcorr .8x_height#*slant+.5stem#-u#;
  129. adjust_fit(0,0); pickup fine.nib;
  130. x0=0; x1=x2; pos2(stem,0); lft x2l=hround(2.5u-.5stem); y2-.5stem=-oo;
  131. hook_in(0,a,1);  % opening hook
  132. filldraw circ_stroke z2e--z1e;  % left stem
  133. x4+.5stem=hround(w-1.5u+.5stem); ital_arch(2,3,4);  % arch
  134. pos5(stem,0); x5=x4; y5-.5stem=-d-o;
  135. filldraw circ_stroke z5e--z4e;  % right stem
  136. math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#-1/3x_height#*slant);
  137. penlabels(0,a,1,2,3,4,5); endchar;
  138.  
  139. cmchar "Lowercase Greek theta";
  140. beginchar(oct"022",8.25u#,asc_height#,0);
  141. italcorr .7asc_height#*slant+.5curve#-u#;
  142. adjust_fit(0,0); pickup fine.nib;
  143. pos1(vair,90); pos2(curve,180); pos3(vair,270); pos4(curve,360);
  144. x1=x3=.5w; lft x2r=hround(1.5u-.5curve); x4=w-x2;
  145. top y1r=h+oo; y2=y4=.5[y1,y3]; bot y3r=-oo;
  146. filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
  147.  & pulled_arc.e(3,4) & pulled_arc.e(4,1);  % bowl
  148. pos2'(bar,90); pos4'(bar,90); z2'=z2l; z4'=z4l;
  149. filldraw stroke z2'e--z4'e;  % bar
  150. math_fit(-.3asc_height#*slant-u#+.5curve#,ic#-.5u#);
  151. penlabels(1,2,3,4); endchar;
  152.  
  153. cmchar "Lowercase Greek iota";
  154. beginchar(oct"023",5u#,x_height#,0);
  155. italcorr 1/3x_height#*slant+.5hair#+.5u#;
  156. adjust_fit(if monospace: u#,u# else: 0,0 fi); pickup fine.nib;
  157. pos1(stem,0); lft x1l=hround(1.5u-.5stem); y1+.5stem=h+oo;
  158. x2=x1-.25u; x4=w; hook_out(2,3,4)(skewed);  % closing hook
  159. filldraw circ_stroke z1e{down}...{-u,-x_height}z2e;  % stem
  160. math_fit(0,ic#); penlabels(1,2,3,4); endchar;
  161.  
  162. cmchar "Lowercase Greek kappa";
  163. beginchar(oct"024",9u#,x_height#,0);
  164. italcorr 1/3x_height#*slant+.5hair#+.5u#;
  165. adjust_fit(0,0); pickup fine.nib;
  166. pos1(stem,0); pos2(stem,0); pos3(vair,90); pos4(vair,90); pos5(flare,90);
  167. x1=x2=x3; lft x1l=hround(1.5u-.5stem); y1+.5stem=h+oo; y2-.5stem=-oo;
  168. filldraw z1l---z2l..z2r---z1r..cycle;  % stem
  169. y3=bar_height; top y4r=h; x4+.5flare=hround(w-1.5u); z5r=z4r;
  170. path p,q; p=z3l{right}..{right}z4l; q=z5r{right}..z5l{left}...cycle;
  171. numeric t; t=ypart(p intersectiontimes q);
  172. filldraw stroke z3e{right}..{right}z4e;  % upper diagonal
  173. filldraw subpath(0,t) of q--cycle;  % bulb
  174. pos7(stem,0); pos8(vair,90); pos9(hair,180);
  175. x9+.5hair=hround(w+.5hair-epsilon); y9=1/3x_height;
  176. lft x7l=hround(w-2.75u-.5stem); y7=1/2y3; x8=w-1.2u; bot y8l=-oo;
  177. filldraw stroke z3e{right}...z7e{down}
  178.  ...z8e{right}...{up}z9e;  % lower diagonal
  179. math_fit(0,ic#); penlabels(1,2,3,4,5,7,8,9); endchar;
  180.  
  181. cmchar "Lowercase Greek lambda";
  182. beginchar(oct"025",10.5u#,asc_height#,0);
  183. adjust_fit(0,0); pickup fine.nib;
  184. pos1(vair,90); lft x1=hround .1u; top y1r=h;
  185. x2=x1+2u;